import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);

export default {
    path: '/sysUser',
    component: Layout,
    name: 'sysUser',
    meta: {title: '系统用户', icon: 'icon'},
    children: [
        {
          path: 'admin',
          component: _import('sysUser/admin/list'),
          name: 'userAdminList',
          meta: {
            title: '用户管理',
            buttons: {
              add: { label: '新建', enabled: true },
              edit: { label: '编辑', enabled: true },
              operate: { label: '启用/禁用', enabled: true },
              passwordReset: { label: '重置密码', enabled: true }
            }
          }
        },
        {
            path: 'role',
            component: _import('sysUser/role/list'),
            name: 'userRole',
            meta: {
              title: '角色管理',
              buttons: {
                add: { label: '新建', enabled: true },
                edit: { label: '编辑', enabled: true },
                delete: { label: '删除', enabled: true }
              }
            },
        },
        {
            path: 'role/add',
            component: _import('sysUser/role/edit'),
            name: 'userRoleAdd',
            meta: {title: '角色添加', roles: [1], index: '/sysUser/role'},
            hidden: true
        },
        {
            path: 'role/edit/:id',
            component: _import('sysUser/role/edit'),
            name: 'userRoleEdit',
            meta: {title: '角色编辑', roles: [1], noCache: true, index: '/sysUser/role'},
            hidden: true,
            props: true
        },
        /* {
            path: 'access',
            component: _import('sysUser/access/list'),
            name: 'userAccessList',
            meta: {title: '资源管理', roles: [1]},
        }, */
        {
            path: 'organization',
            component: _import('sysUser/organization/list'),
            name: 'userOrganizationList',
            meta: {
              title: '组织机构',
              buttons: {
                add: { label: '新建', enabled: true },
                edit: { label: '编辑', enabled: true }
              }
            },
        },
        /*{
            path: 'oldMerchant',
            component: _import('sysUser/oldMerchant/list'),
            name: 'oldMerchantList',
            meta: {title: '旧商家管理'},
        },*/
        {
          path: 'merchant',
          component: _import('sysUser/merchant/list'),
          name: 'merchantList',
          meta: {
            title: '商家管理',
            buttons: {
              add: { label: '新建', enabled: true },
              edit: { label: '编辑', enabled: true },
              passwordReset: { label: '重置密码', enabled: true }
            }
          }
        },
        {
          path: 'officialUser',
          component: _import('sysUser/officialUser/index'),
          name: 'officialUser',
          meta: {
            title: '官方用户管理',
            buttons: {
              add: { label: '新建', enabled: true },
              remove: { label: '移除官方', enabled: true },
              viewDetails: { label: '查看详情', enabled: true }
            }
          }
        },
        {
          path: 'officialUser/viewDetails/:id',
          component: _import('user/member/detail'),
          name: 'officialUserViewDetails',
          meta: { title: '会员详情', noCache: true, index: '/user/member/list' },
          hidden: true,
          props: true
        },
    ]
}
